<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>函数</title>
	<script>

			window.onload = function(){
				var oBtn = document.getElementById('button1')
				oBtn.onclick = fnChange;
			}

			function fnChange(){				
				var oDiv = document.getElementById('div1');
				oDiv.style.color = 'red';
				oDiv.style.fontSize = "30px"
			}


	</script>
</head>
<body>
	<div id="div1">这是个div标签</div>
	<input id = "button1" type="button" value="点击" >
</body>
</html>